package net.imain.cloud.feign;

import feign.Param;
import feign.RequestLine;
import net.imain.config.CustomConfig;
import net.imain.cloud.pojo.User;
import org.springframework.cloud.netflix.feign.FeignClient;

/**
 * Feign
 *      这个注解创建一个ApplicationContext，也就是Spring的子容器
 * @author: uncle
 * @apdateTime: 2017-12-12 19:28
 */
@FeignClient(name = "service-user", configuration = CustomConfig.class)
public interface UserFeignClient {
    /**
     * 请求的服务端的API
     *
     * @param id
     * @return
     */
    @RequestLine("GET /user/{id}")
    User findById(@Param(value = "id") Long id);
}